/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package be;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * Sistema de Control Acádemico (saca) creado por Buñay Paulo
 */
@Entity
@Table(name = "DETALLE_DOCENTE_ANIO_LECTIVO_MATERIA")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "DetalleDocenteAnioLectivoMateria.findAll", query = "SELECT d FROM DetalleDocenteAnioLectivoMateria d"),
    @NamedQuery(name = "DetalleDocenteAnioLectivoMateria.findByIdDetalleDocenteAnioLectivoMateria", query = "SELECT d FROM DetalleDocenteAnioLectivoMateria d WHERE d.idDetalleDocenteAnioLectivoMateria = :idDetalleDocenteAnioLectivoMateria")})
public class DetalleDocenteAnioLectivoMateria implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID_DETALLE_DOCENTE_ANIO_LECTIVO_MATERIA")
    private Integer idDetalleDocenteAnioLectivoMateria;
    @JoinColumn(name = "ID_MATERIA", referencedColumnName = "ID_MATERIA")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Materia materia;
    @JoinColumn(name = "ID_DETALLE_DOCENTE_ANIO_LECTIVO", referencedColumnName = "ID_DETALLE_DOCENTE_ANIO_LECTIVO")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private DetalleDocenteAnioLectivo detalleDocenteAnioLectivo;

    public DetalleDocenteAnioLectivoMateria() {
    }

    public DetalleDocenteAnioLectivoMateria(Integer idDetalleDocenteAnioLectivoMateria) {
        this.idDetalleDocenteAnioLectivoMateria = idDetalleDocenteAnioLectivoMateria;
    }

    public Integer getIdDetalleDocenteAnioLectivoMateria() {
        return idDetalleDocenteAnioLectivoMateria;
    }

    public void setIdDetalleDocenteAnioLectivoMateria(Integer idDetalleDocenteAnioLectivoMateria) {
        this.idDetalleDocenteAnioLectivoMateria = idDetalleDocenteAnioLectivoMateria;
    }

    public Materia getMateria() {
        return materia;
    }

    public void setMateria(Materia materia) {
        this.materia = materia;
    }

    public DetalleDocenteAnioLectivo getDetalleDocenteAnioLectivo() {
        return detalleDocenteAnioLectivo;
    }

    public void setDetalleDocenteAnioLectivo(DetalleDocenteAnioLectivo detalleDocenteAnioLectivo) {
        this.detalleDocenteAnioLectivo = detalleDocenteAnioLectivo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idDetalleDocenteAnioLectivoMateria != null ? idDetalleDocenteAnioLectivoMateria.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DetalleDocenteAnioLectivoMateria)) {
            return false;
        }
        DetalleDocenteAnioLectivoMateria other = (DetalleDocenteAnioLectivoMateria) object;
        if ((this.idDetalleDocenteAnioLectivoMateria == null && other.idDetalleDocenteAnioLectivoMateria != null) || (this.idDetalleDocenteAnioLectivoMateria != null && !this.idDetalleDocenteAnioLectivoMateria.equals(other.idDetalleDocenteAnioLectivoMateria))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "be.DetalleDocenteAnioLectivoMateria[ idDetalleDocenteAnioLectivoMateria=" + idDetalleDocenteAnioLectivoMateria + " ]";
    }

}
